﻿<ResourceDictionary 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:notePadUi="clr-namespace:TfsWorkbench.NotePadUI"
    xmlns:helpers="clr-namespace:TfsWorkbench.NotePadUI.Helpers">
    
    <ControlTemplate x:Key="UndecoratedButton" TargetType="Button">
        <ContentPresenter 
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center" 
                    Name="content"
                    />
    </ControlTemplate>
    
    <Style x:Key="RedMouseOverButton" TargetType="Button">

        <Setter Property="Template" Value="{StaticResource UndecoratedButton}" />
        <Setter Property="notePadUi:DragBehaviour.DragAction" Value="None" />
        <Setter Property="Cursor" Value="Hand" />
        
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Foreground" Value="DarkRed" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <helpers:PassThroughConverter x:Key="PassThroughConverter" />

    <Style x:Key="ColourSelectorMenu" TargetType="MenuItem">
        <Setter Property="Command" Value="{x:Static notePadUi:LocalCommandLibrary.ChangeColourCommand}" />
        <Setter Property="CommandTarget" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type ContextMenu}}}" />
        <Setter Property="Background" Value="{Binding RelativeSource={RelativeSource self}, Path=Header}" />
        <Setter Property="CommandParameter">
            <Setter.Value>
                <MultiBinding Converter="{StaticResource PassThroughConverter}">
                    <Binding />
                    <Binding RelativeSource="{RelativeSource Self}" Path="Header" />
                </MultiBinding>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>